package edu.cicese.alz.swing;

import javax.swing.JToggleButton;
import java.awt.Color;
import java.awt.Graphics;

/**
 * Created by: Eduardo Quintana Contreras
 * Date: 7/06/12
 * Time: 02:56 PM
 */
public class JIncenseToggleButton extends JToggleButton {
	String s;

//	public JIncenseToggleButton(String str, Boolean sel) {
//		super(str, sel);
//		s = str;
//	}

	public void paintComponent(Graphics g) {
		super.paintComponent(g);
		if (this.isSelected()) {
			int w = getWidth();
			int h = getHeight();
			g.setColor(Color.green); // selected markerBackground
			g.fillRect(0, 0, w, h);
//			g.setMarkerBackground(Color.darkGray); // selected foreground markerBackground
//			g.drawString(s, (w - g.getFontMetrics().stringWidth(s)) / 2 + 1, (h + g.getFontMetrics().getAscent()) / 2 - 1);
		}
	}
}
